Not Applicable.
Not applicable.
This invention relates generally to automated optical inspection (AOI) systems and more particularly to illumination systems used in AOI systems.
As is known in the art, an automated optical inspection (AOI) system typically includes an illumination system which projects or otherwise provides light to illuminate a specimen being inspected and a camera which captures an image of the specimen and converts it to electrical signals. One or more frame grabbers transfer the electrical signals representing the image to a computer or other processing device for further processing.
It is difficult, however, to produce uniform illumination over the field of view of a camera. A processing device which is unaware of the specific nonuniformities in lighting cannot differentiate between those patterns of light in the image which are due to the appearance of the specimen and those patterns of light in the image which are due to irregularities in the illumination system.
For example, an image of a uniformly illuminated plain uniform grey surface ideally has pixel values which are all equal. In practice, however, the pixel values will not be equal unless the camera is ideal and the illumination is perfectly uniform. The computer or other processing device receives a xe2x80x9ctruexe2x80x9d image only if the effects of nonuniform illumination can somehow be cancelled out. Nonuniformity of illumination is thus a source of noise in AOI systems.
There are a number of reasons for nonuniform illumination in AOI Systems. A typical illumination system includes one or more fluorescent lamps. On problem with fluorescent and other types of lamps is that intensity of the lamp varies along the length of the lamp. The intensity also varies with the amount of current provided to the lamp, the age of the lamp, specific variations in the manufacture of the lamp including its shape, and the temperature at which the lamp operates. It is a daunting prospect to attempt to regulate the light at one point, let alone regulate the light at all points on the object. Thus, suffice it to say that for a variety of reasons, it is relatively difficult to produce uniform illumination over the field of view of a camera.
One technique to overcome this illumination problem is to use lamps which provide relatively uniform intensity. Such lamps, however, are relatively expensive. More importantly perhaps such lamps still have variations in intensity although the variations are less severe than the intensity variations in relatively low cost lamps.
It would, therefore, be desirable to provide a system for compensating nonuniformity in an image due to variations in illumination characteristics. It would also be desirable to provide an AOI system for printed circuit boards which compensates for variations in illumination characteristics. It would be further desirable to provide a system which performs compensation in real time.
In accordance with the present invention, an automated optical inspection (AOI) system includes an image acquisition system for capturing an image and for providing a digital signal to a compensation circuit which compensates the pixel values to provide compensated or corrected pixel values. The compensation circuit provides the compensated pixel values in real time to a video frame memory and to a direct memory access (DMA) channel. The DMA channel transfers the compensated pixel values to a storage device which is coupled to or provided as part of a processor.
With this particular arrangement, an AOI system which corrects errors in a digital image due to illumination is provided. The system corrects the errors on a pixel by pixel basis as signals representing the video frame are being transferred from the image acquisition system to a frame memory. By storing compensation values in the compensation circuit and coupling the compensation circuit to a DMA channel, it is possible to compensate the pixel values in real time as the pixel values are transmitted from the image acquisition system to the frame memory. Compensating the pixels for irregularities in real time makes it possible to continue processing video information obtained by the image acquisition system at the same rate as without correction. In one embodiment, the image acquisition system includes a digital camera and in another embodiment the image acquisition system includes an analog camera having a video digitizer coupled thereto.
The details of the compensation memory architecture vary with the nature of the aberrations expected during inspection. For example, if a pure linear correction with no offset errors is expected, only a scale factor memory is needed. On the other hand, if offset errors are expected, then an offset memory is also required (e.g. to eliminate the effects of unexcludable stray light). If a nonlinear correction is needed, additional scale memories and associated arithmetic circuits to perform scale factor computations may be needed. In a preferred embodiment, only offset and scale factor are linearly corrected. It should be appreciated, however, that the concept of performing real time correction can be extended beyond simple linear calculations or reduced to simpler linear multiples without offset correction.
In preferred embodiments, the system uses a plurality of lighting modes and it may be desirable to provide the compensation memory from a plurality of separate banks of memories with each bank storing a set of correction or compensation coefficients. In this case, each lighting mode use a separate bank and thus a separate set of compensation coefficients. When multiple memory banks are used, a bank switch coupled between processor and the compensation memory allows the processor to select a particular one or ones of the banks of compensation memory. The appropriate memory bank is selected by the processor prior to the time a frame is acquired. In particular, the processor selects particular values in the memory to be used according to which lighting mode will be used.
In one embodiment, the compensation circuit includes a compensation memory coupled to an adder circuit and a multiplier circuit. The image acquisition circuit provides a pixel value (in the form of a digital signal) to a first port of the adder circuit and the compensation memory provides an offset value to a second port of the adder circuit. The adder circuit combines the two values fed thereto and provides a partially compensated pixel value to the input of the multiplication circuit. The multiplication circuit further compensates the pixel value prior to providing the fully compensated pixel value to the video frame memory and the DMA channel.
A further advantage of the present invention is that the cost of illumination hardware can be reduced. As mentioned above, relatively low cost illuminators tend to have worse nonuniformities than relatively expensive illuminators. The present invention, however, makes it possible to tolerate greater irregularity in the illumination, and therefore makes it possible to employ relatively low cost illuminators while still achieving an accuracy which is equivalent to that obtained with relatively high cost illuminators.
In accordance with a further aspect of the present invention, an AOI system includes an image acquisition system having an output port coupled to a first input port of an adder circuit. A second input of the adder circuit is coupled to an offset memory and an output of the adder circuit is coupled to a first input of a multiplier circuit. A second input of the multiplier circuit is coupled to an offset memory and an output of the multiplier circuit has an output coupled to a video frame memory and a DMA channel. The DMA channel is coupled to a processor memory. The processor memory may be provided, for example, either as a main memory in a so-called xe2x80x9cmotherboardxe2x80x9d or as a processor on a frame grabber module which includes bother the frame grabber processor and a frame grabber memory.
With this particular arrangement, an AOI system which corrects pixel values in a digital image on a pixel by pixel basis as the signals representing the video frame are transferred from the image acquisition system to the frame memory is provided. The adder, multiplier and memory circuits operate at a speed which is coefficient to allow the system to compensate pixel values in real time, thus allowing compensated or corrected pixel values to be stored in the memory for later processing.
A further advantage of the present invention is that in the case where the image acquisition system includes both a camera and a digitizer, the invention simultaneously compensates for linear nonuniformities in the camera and in the digitizer as well as for illumination nonuniformity. If the digitizer had a constant offset, for example, that offset would be removed in the calibration process described here.
The digitized pixel values contain signal information from the inspected specimen and error information caused by uneven illumination. The digitized pixel values are presented to the second input of the adding circuit.
The output of the adding circuit is a pixel value which has been corrected for offset. It is presented to the second input of the multiplication circuit. The output of the multiplication circuit is a pixel value which has been corrected for scale and offset.
The addition and multiplication circuits can be implemented in any of several ways known to those skilled in the art of arithmetic circuitry. In the preferred embodiment the adder and multiplier can be generated using Very high speed integrated circuit Hardware Descriptive Language (VHDL) software statements compiled for a programmable gate array.
The correction coefficient memories may be organized in any convenient way. In the preferred embodiment, it is sixteen million sixteen-bit words in which each sixteen-bit word is broken up into eight bits of offset coefficient and eight bits of scale coefficient. Embodiments are envisioned in which fewer bits of offset are used and more bits of scale, or vice versaxe2x80x94this would be appropriate if the variation in offset were small and the variation in scale were large. It might be reasonable in some cases to represent both scale and offset values in a total of eight bits, with three bits for offset and five bits for scale.
Other ways of managing multiple blocks of correction coefficients for multiple lighting modes are contemplated as well. For example, if memory cost were important and lighting modes were infrequently changed, the time of reloading a lighting mode""s information would not be important. The bank switch could be eliminated (or set to a constant value) and the entire memory could be reloaded from the computer for each separate lighting mode. This would allow the invention to be realized with smaller memories, but would use time in reloading the memories, as opposed to the much faster bank switch. In the case where only one lighting mode is used, only one memory bank (or one set of memory banks) is needed.
The output of the multiplication circuit is a corrected pixel valuexe2x80x94the value the pixel would have had if the illumination had been uniform. The pixel has been corrected for offset and for scale. The corrected value is stored in frame memory in lieu of the original raw digitized pixel, as would have been stored by a conventional framegrabber.
The correction has been made in real time, so the computer can process corrected pixels as fast as if they had not been corrected. No central processor cycles are used in making the correction.
In accordance with a further aspect of the present invention, a method for correcting errors in an AOI system includes the steps of (a) acquiring a frame and digitizing each pixel in the frame, (b) generating an address to indicate where the pixel is to be stored in a video frame memory, (c) retrieving correction values related to the pixel position and (d) combining the correction values with the digitized pixel value to provide a corrected pixel value.
With this particular arrangement, a method for real-time compensation of pixel values in an AOI system is provided. The correction values correspond to offset and scale correction values. The correction values are combined with the pixel values by first adding an offset correction value to the digitized pixel value to provide a partially corrected digitized pixel value and then by multiplying the corrected digitized pixel value by a scale correction value to provide a fully corrected pixel value.